//
//  MessageDetailCell.m
//  MIDI
//
//  Created by E.M.Game on 15/9/11.
//  Copyright (c) 2015年 QXSX. All rights reserved.
//

#import "MessageDetailCell.h"
#import "AppConfig.h"
#import "CommFunc.h"

@interface MessageDetailCell ()

@end

@implementation MessageDetailCell

- (void)awakeFromNib
{

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"MessageDetailCell";
    MessageDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        
        cell = [[[NSBundle mainBundle] loadNibNamed:ID owner:nil options:nil]firstObject];
        
        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    }
    
    return cell;
}

-(int)getHeight
{
    int height = [CommFunc sizeWithString:self.messageContent.text
                        font:[UIFont fontWithName:@"Hiragino Sans GB" size:13]
                         max:CGSizeMake(self.messageContent.frame.size.width, MAXFLOAT)].height;
    
    if (height <= 0)
        return 357;
    else
    {
        height = self.messageContent.frame.origin.y + height + 17;
        return height;
    }
    
    return 0;
}


@end
